<!DOCTYPE html>
<html>
  <head>
    <title>FileWriter Example</title>

    <script type="text/javascript" charset="utf-8" src="js/phonegap-1.4.0.js"></script>
    <script type="text/javascript" charset="utf-8">

   // document.addEventListener("deviceready", false, false);

    
    function onDeviceReady() {
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
    }

    function gotFS(fileSystem) {
        fileSystem.root.getDirectory("TianTianMusic", {create: true, exclusive: false}, gotFileEntry, fail);
    }

    function gotFileEntry(fileEntry) {
      var read=  fileEntry.createReader();
		read.readEntries(gotFileWriter,null);
    }

    function gotFileWriter(entries) {
        
		var i;
											for(i=0;i< entries.length;i++) {
												console.log(entries[i].name);
											}
    }

    function fail(error) {
        console.log(error.code);
    }
   
	
    </script>
  </head>
  <body>
    <h1>Example</h1>
    <p>Write File</p>
	<button onclick="onDeviceReady()">dafasf</button>
  </body>
</html>
